package com.ruoyi.voucher.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 凭证模板对象 financial_voucher_template
 *
 * @author ruoyi
 * @date 2025-02-23
 */
@TableName("financial_voucher_template")
public class VoucherTemplate extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 模板ID */
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 模板名称 */
    @Excel(name = "模板名称")
    @NotBlank(message = "模板名称不能为空")
    private String templateName;


    /** 附单据数量 */
    @Excel(name = "附单据数量")
    private Long attachmentCount;

    /** 合计金额 */
    @Excel(name = "合计金额")
    private BigDecimal totalAmount;

    /** 模板类型ID */
    @Excel(name = "模板类型ID")
    @NotNull(message = "模版类型不能为空")
    private Long typeId;

    /** 账套ID */
    @Excel(name = "账套ID")
    private Long accountSetsId;


    /** 逻辑删除 */
    @Excel(name = "逻辑删除")
    private Integer isDeleted;

    /** 版本号 */
    @Excel(name = "版本号")
    private Long version;

    @TableField(exist = false)
    private List<VoucherTemplateDetail> details;

    public List<VoucherTemplateDetail> getDetails() {
        return details;
    }

    public void setDetails(List<VoucherTemplateDetail> details) {
        this.details = details;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setTemplateName(String templateName)
    {
        this.templateName = templateName;
    }

    public String getTemplateName()
    {
        return templateName;
    }

       public void setAttachmentCount(Long attachmentCount)
    {
        this.attachmentCount = attachmentCount;
    }

    public Long getAttachmentCount()
    {
        return attachmentCount;
    }
    public void setTotalAmount(BigDecimal totalAmount)
    {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount()
    {
        return totalAmount;
    }
    public void setTypeId(Long typeId)
    {
        this.typeId = typeId;
    }

    public Long getTypeId()
    {
        return typeId;
    }
    public void setAccountSetsId(Long accountSetsId)
    {
        this.accountSetsId = accountSetsId;
    }

    public Long getAccountSetsId()
    {
        return accountSetsId;
    }
      public void setIsDeleted(Integer isDeleted)
    {
        this.isDeleted = isDeleted;
    }

    public Integer getIsDeleted()
    {
        return isDeleted;
    }
    public void setVersion(Long version)
    {
        this.version = version;
    }

    public Long getVersion()
    {
        return version;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("templateName", getTemplateName())
                .append("attachmentCount", getAttachmentCount())
                .append("totalAmount", getTotalAmount())
                .append("typeId", getTypeId())
                .append("accountSetsId", getAccountSetsId())
                .append("isDeleted", getIsDeleted())
                .append("version", getVersion())
                .toString();
    }
}
